#pragma once
#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>
#include <SFML/Vector2.hpp>
#include "Animation.h"


class minigun
{
public:
	minigun();
	~minigun();

	void initialize(sf::RenderWindow* window);
	void update();
	void cleanup();

	sf::Sprite* m_bulletSprite;

private:

	sf::RenderWindow* m_renderWindow;
	sf::Clock* m_clock;
	Animation* m_minigunAnimation;
	Animation* m_bulletAnimation;
	sf::Sprite* m_minigunSprite;

	Animation* m_hatchOpenAnimation;
	sf::Sprite* m_hatchOpenSprite;

	Animation* m_muzzleAnimation;
	sf::Sprite* m_muzzleSprite;

	Animation* m_hatchCloseAnimation;
	sf::Sprite* m_hatchCloseSprite;

	sf::Texture m_openTexture;
	sf::Sprite* m_openSprite;
	
	sf::Clock* deltaClock;
	sf::Time deltaTime;
	float rotationSpeed;

	float elapsedTime;

	sf::Sound m_windUpSound;
	sf::SoundBuffer m_windUpBuffer;

	sf::Sound m_kortSound;
	sf::SoundBuffer m_kortBuffer;

	sf::Sound m_spinSound;
	sf::SoundBuffer m_spinBuffer;

	sf::Sound m_windDownSound;
	sf::SoundBuffer m_windDownBuffer;

	bool playWindDown;

	bool startSpinSound;

};

